////////////////////////////////////////////////////////////////////////////////
// Copyright 2010 Michael Schmalle - Teoti Graphix, LLC
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
// http://www.apache.org/licenses/LICENSE-2.0 
// 
// Unless required by applicable law or agreed to in writing, software 
// distributed under the License is distributed on an "AS IS" BASIS, 
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and 
// limitations under the License
// 
// Author: Michael Schmalle, Principal Architect
// mschmalle at teotigraphix dot com
////////////////////////////////////////////////////////////////////////////////

package org.teotigraphix.swizplugin.bundles
{

import org.teotigraphix.swizplugin.api.IExecutableRequest;

/**
 * The <strong>IBundle</strong> is a group of classes, interfaces, components 
 * and assets.
 * 
 * @author Michael Schmalle
 * @copyright Teoti Graphix, LLC
 * @productversion 1.0
 */
public interface IBundle
{
	//--------------------------------------------------------------------------
	//
	//  Properties
	//
	//--------------------------------------------------------------------------
	
	//----------------------------------
	//  bundleID
	//----------------------------------
	
	/**
	 * The bundle's integer id assigned by the framework.
	 */
	function get bundleID():int;
	
	//----------------------------------
	//  symbolicName
	//----------------------------------
	
	/**
	 * The bundle's 'symbolicName' entry from it's manifest.xml header.
	 */
	function get symbolicName():String;
	
	//----------------------------------
	//  state
	//----------------------------------
	
	/**
	 * The current state of the bundle.
	 * 
	 * @see org.teotigraphix.swizplugin.api.BundleState
	 */
	function get state():int;
	
	//----------------------------------
	//  context
	//----------------------------------
	
	/**
	 * The bundle's application conext.
	 */
	function get context():IBundleContext;
	
	//--------------------------------------------------------------------------
	//
	//  Methods
	//
	//--------------------------------------------------------------------------
	
	/**
	 * Loads a class from the bundle.
	 * 
	 * @param className A String indiacting the Class to load from the bundle.
	 */
	function loadClass(className:String):IExecutableRequest;
	
	/**
	 * Returns a Class definition found in the bundle.
	 * 
	 * @param className A String className.
	 * @return A Class reference or <code>null</code>.
	 */
	function getDefinition(className:String):Class;
	
	/**
	 * Returns whether the bundle contains a Class reference for the
	 * className.
	 * 
	 * @param className A String className.
	 * @return A Boolean indicating whether the reference exits.
	 */
	function hasDefinition(className:String):Boolean
}
}